import os

import torch
from torchvision import models
from torchvision.transforms import transforms
import h5py
import cv2
import sys
import numpy as np
import matplotlib as plt
from PIL import Image

categories = ['ADI_particle_developed', 'Array_peeling', 'Cu_missing', 'Other_peeling', 'Partial_etch',
                  'Pattern_fail',
                  'PR_peeling', 'Seam', 'Reference', 'Surface_particle', 'Burried_particle', 'Cu_diffuse',
                  'Prelayer_defect_developed',
                  'Void', 'Residue', 'Scratch']
categories_to_id = dict((c, i) for i, c in enumerate(categories))
id_to_categories = dict((v, k) for k, v in categories_to_id.items())


h5file = r"./Bump_FY-C201F_MD_ASI_lFFK100951_w1_880_Topography3.h5"


f = h5py.File(h5file, 'r')  # 打开h5文件
print(f.keys())
class_tiff = f['class_tiff'][:]
defect_tiff = f['defect_tiff'][:]
label = f['label']
f.close()
